#region License Information
// Copyright (c) 2005 - 2009, Allan Spartacus Mangune (allan@owlpal.com)
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, 
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this list 
//   of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright notice, this list of 
//   conditions and the following disclaimer in the documentation and/or other materials provided 
//   with the distribution.
//
// * Neither the name of Owlpal nor the names of its contributors may be used to endorse or 
//   promote products derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
// FITNESS FOR AllowHtmlInComment PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 
// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Owlpal.Blogs.Models
{
    /// <summary>
    /// 
    /// </summary>
    public partial class Category
    {
        private int entryCount;
        private Guid id;
        private Classification classification;
        private Category parentCategory;
        private Blog blog;
        private string name;
        private string description;
        private bool isVisible;
        private bool isDeleted;
        private System.Web.Security.MembershipUser updatedBy;
        private DateTime creationDate;
        private DateTime lastUpdateDate;
        private System.Web.Security.MembershipUser createdBy;

        /// <summary>
        /// Gets or sets the unique ID of this Category.
        /// </summary>
        public Guid ID
        {
            get { return this.id; }
            set { this.id = value; }
        }

        /// <summary>
        /// Gets or sets the Classification of this Category.
        /// </summary>
        public Classification Classification
        {
            get { return this.classification; }
            set { this.classification = value; }
        }

        /// <summary>
        /// Gets or sets the parent of this Category.
        /// </summary>
        public Category ParentCategory
        {
            get { return this.parentCategory; }
            set { this.parentCategory = value; }
        }

        /// <summary>
        /// Gets or sets the Blog to which this Category belongs to.
        /// </summary>
        public Blog Blog
        { 
            get {return this.blog; }
            set { this.blog = value; }
        }

        /// <summary>
        /// Gets or sets the name of this Category.
        /// </summary>
        public string Name
        {
            get { return this.name; }
            set { this.name = value; }
        }

        /// <summary>
        /// Gets or sets the description of this Category.
        /// </summary>
        public string Description
        {
            get { return this.description; }
            set { this.description = value; }
        }

        /// <summary>
        /// Gets or sets a value indicating whether or not this Category is visible to public.
        /// </summary>
        public bool IsVisible
        {
            get { return this.isVisible; }
            set { this.isVisible = value; }
        }

        /// <summary>
        /// Gets or sets a value indicating whether or not this Category was deleted.
        /// </summary>
        public bool IsDeleted
        {
            get { return this.isDeleted; }
            set { this.isDeleted = value; }
        }

        /// <summary>
        /// Gets or sets the User who updated this Category.
        /// </summary>
        public System.Web.Security.MembershipUser UpdatedBy
        {
            get { return this.updatedBy; }
            set { this.updatedBy = value; }
        }

        /// <summary>
        /// Gets or sets the date in which the Category was created.
        /// </summary>
        public DateTime CreationDate
        {
            get { return this.creationDate; }
            set { this.creationDate = value; }
        }

        /// <summary>
        /// Gets or sets the date in which this Category was last updated.
        /// </summary>
        public DateTime LastUpdateDate
        {
            get { return this.lastUpdateDate; }
            set { this.lastUpdateDate = value; }
        }

        /// <summary>
        /// Gets or sets the User who created this Category.
        /// </summary>
        public System.Web.Security.MembershipUser CreatedBy
        {
            get { return this.createdBy; }
            set { this.createdBy = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        public int EntryCount
        {
            get { return this.entryCount; }
            set { this.entryCount = value; }
        }

        /// <summary>
        /// Loads a collection of Categories based on BlogID attribute.
        /// </summary>
        /// <param name="unitPrice">The BlogID attribute.</param>
        /// <returns>AllowHtmlInComment collection of Categories.</returns>
        public static List<Category> FindAllByBlogID(System.Guid blogID)
        {
         return null;
        }

        /// <summary>
        /// Loads a collection of Categories based on BlogID attribute.
        /// </summary>
        /// <param name="unitPrice">The BlogID attribute.</param>
        /// <param name="pageIndex">The index in the collection.</param>
        /// <param name="pageSize">The size of the collection.</param>
        /// <returns>AllowHtmlInComment collection of Categories.</returns>
        public static List<Category> FindAllByBlogID(System.Guid blogID, int pageIndex, int pageSize)
        {
            return null;
        }

        /// <summary>
        /// Loads a collection of Categories.
        /// </summary>
        /// <param name="products">The Categories object that will hold the collection of Categories.</param>
        /// <param name="query">The query executed against the database.</param>
        private static List<Category> LoadCategories(IQueryable<Category> query)
        {
            List<Category> categories = new List<Category>();
            return categories;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="blogName"></param>
        /// <param name="classification"></param>
        /// <returns></returns>
        public static List<Category> FindAllParents(string blogName, Classification classification)
        {
            List<Category> categories = new List<Category>();
            return categories;
        }

        /// <summary>
        /// Creates a Category.
        /// </summary>
        /// <returns>Returns the status of the Add operation.</returns>
        public AddCategoryStatus Save()
        {
            AddCategoryStatus status = AddCategoryStatus.UnknownError;
            return status;
        }
    }
}